package com.wavefront.obj.parser.line;

import com.wavefront.obj.elements.VertexG;
import com.wavefront.obj.parser.LineParser;
import com.wavefront.obj.parser.ObjParser;

public class VertexParser extends LineParser {

	VertexG vertex = null;

	public VertexParser() {
	}

	@Override
	public void parse(String[] words) {
		super.parse(words);
		vertex = ObjParser.currentModel.createVertexG();

		try {
			vertex.setX(Float.parseFloat(words[1]));
			vertex.setY(Float.parseFloat(words[2]));
			vertex.setZ(Float.parseFloat(words[3]));
		} catch (Exception e) {
			throw new RuntimeException("VertexParser Error");
		}
	}

}
